load("@prelude//toolchains/android/tools:build_rules.bzl", "OPEN_JDK_COMPILER_ARGS", "buck_java_library", "buck_java_test")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("android_devxx")

source_listing()

buck_java_test(
    name = "source",
    srcs = glob(["*Test.java"]),
    _java_toolchain = "toolchains//:java_for_android",
    required_for_source_only_abi = True,
    vm_args = OPEN_JDK_COMPILER_ARGS,
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source:source",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source/api:api",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/lang/model:model",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/plugin/adapter:adapter",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/version/utils:utils",
        "prelude//toolchains/android/src/com/facebook/buck/util:util",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/abi/source:testutil",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/plugin/adapter:testutil",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/testutil/compiler:compiler",
        "prelude//toolchains/android/third-party:asm",
        "prelude//toolchains/android/third-party:guava",
        "prelude//toolchains/android/third-party:jackson-databind",
        "prelude//toolchains/android/third-party:jsr305",
        "prelude//toolchains/android/third-party:junit",
    ],
)

buck_java_library(
    name = "testutil",
    srcs = glob(
        ["*.java"],
        exclude = ["*Test.java"],
    ),
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java:support",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi:abi",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source:source",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/abi/source/api:api",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/lang/model:model",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/plugin/adapter:adapter",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/java/plugin/api:api",
        "prelude//toolchains/android/test/com/facebook/buck/jvm/java/testutil/compiler:compiler",
        "prelude//toolchains/android/third-party:asm",
        "prelude//toolchains/android/third-party:guava",
        "prelude//toolchains/android/third-party:jsr305",
        "prelude//toolchains/android/third-party:junit",
    ],
)
